import request from '@/utils/request'


// 获取设备类型列表 分页
export function getList(data) {
  return request({
    url: '/equipment/equipment_type/equipment_type_list',
    method: 'get',
    params: data
  })
}

// 获取设备类型列表 不分页
export function getEquipmentTypeList() {
  return request({
    url: '/equipment/equipment_type/get_equipment_type_list',
    method: 'get',
   
  })
}



//根据id获取一个设备类型
export function getEquipmentTypeOne(id) {
  return request({
    url: '/equipment/equipment_type/equipment_type_one/' + id,
    method: 'get',
  })
}

/**
 * 添加或者修改设备类型
 */
export function createEquipmentType(data) {
  return request({
    url: '/equipment/equipment_type/create_equipment_type',
    method: 'post',

    params: data
  })
}

/**
 * 移除设备
 */
export function remove(id) {
  return request({
    url: '/equipment/equipment_type/remove_equipment_type/' + id,
    method: 'post',

  })
}

// 获取设备产品列表
export function getProductInfoList(parentId) {
  return request({
    url: '/equipment/equipment_type/equipment_product_info_list'+parentId,
    method: 'get',
  })
}

/**
 * 添加或者修改设备产品
 */
 export function createOrUpdateEquipmentProduct(data) {
  return request({
    url: '/equipment/equipment_type/create_or_update_equipment_product',
    method: 'post',

    params: data
  })
}

/**
 * 添加或者修改型号
 */
 export function createOrUpdateEquipmentmodel(data) {
  return request({
    url: '/equipment/equipment_type/create_or_update_equipment_model',
    method: 'post',
    params: data
  })
}

// 获取设备列表 分页
export function getEquipmentList(data) {
  return request({
    url: '/equipment/equipment_list',
    method: 'get',
    params: data
  })
}


/**
 * 添加设备
 */
 export function createEquipment(data) {
  return request({
    url: '/equipment/create_equipment',
    method: 'post',
    params: data
  })
}


/**
 * 废弃设备
 */
 export function discard(id) {
  return request({
    url: '/equipment/discard_equipment' + id,
    method: 'post',

  })
}


//获取批量导入的 格式文件
export function getImportBatchEquipmentFile() {
  return request({
    url: '/equipment/equipment_type/get_import_batch_equipment_file',
    method: 'get',

  })
}

//上传文件 (批次导入文件)
export function excelURL() {
  return process.env.VUE_APP_BASE_API + '/equipment/equipment_type/import_batch_equipment';
}

// 上传文件 (批次导入文件)
// export function excelURL() {
//   return process.env.VUE_APP_BASE_API + '/common/upload';
// }



// 测试而已
export function test() {
  return request({
    url: '/equipment/equipment_type/test',
    method: 'get',
  
  })
}



export function updateHospital(data, id) {
  return request({
    url: '/user/hospital/' + id,
    method: 'put',
    data
  })
}
